package com.linlin.song.bigwork.service;

import java.sql.SQLException;

import com.linlin.song.bigwork.dao.CustomerDao;
import com.linlin.song.bigwork.entity.Customer;

/**
 * customer的业务逻辑bean
 * @author DELL
 *
 */
public class CustomerService {
	private CustomerDao customerDao = new CustomerDao();

	public void save(Customer customer) throws SQLException {
		this.customerDao.save(customer);
	}

	public Customer check(String name, String password) {
		Customer customer = null;
		try {
			customer = this.customerDao.findByName(name);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return customer;
	}

	public String findPassword(String name, String question, String answer) throws SQLException {
		return this.customerDao.findPassword(name, question, answer);
	}
}
